package net.sending;

import net.message.Message;
import net.receiving.converter.Converter;

import java.io.IOException;
import java.net.DatagramPacket;

import util.Config;

/**
 *
 */
public class Broadcast implements BroadcastMessage {

    private final Message message;

    public Broadcast(Message message) {
        this.message = message;
    }

    public void send(){
        byte[] b = Converter.convertToByteArray(message);
        Util.sendUDPPacket(b, SocketFactory.BROADCAST_HOST);
    }

}
